package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author ：鞠玮
 * 开发团队 ：lxh
 * 开发时间 ：2020/3/11 15:53
 * 类的名称 ：DeliveryProList
 * 类的描述 ：交付产品表
 */
@Entity
@Table(name = "delivery_pro_list", schema = "lxh_crm")
public class DeliveryProList {
    private int deliveryProListId;
    private Integer deliveryCount;
    private Integer deliveriedCount;
    /**合同产品*/
    private ProductList productList;
    /** 交付计划*/
    private DeliveryPlan deliveryPlan;

    @ManyToOne
    @JoinColumn(name = "list_id")
    public ProductList getProductList() {
        return productList;
    }

    public void setProductList(ProductList productList) {
        this.productList = productList;
    }

    @ManyToOne
    @JoinColumn(name = "delivery_plan_id")
    public DeliveryPlan getDeliveryPlan() {
        return deliveryPlan;
    }

    public void setDeliveryPlan(DeliveryPlan deliveryPlan) {
        this.deliveryPlan = deliveryPlan;
    }

    @Id
    @Column(name = "delivery_pro_list_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getDeliveryProListId() {
        return deliveryProListId;
    }

    public void setDeliveryProListId(int deliveryProListId) {
        this.deliveryProListId = deliveryProListId;
    }

    @Basic
    @Column(name = "delivery_count", nullable = true)
    public Integer getDeliveryCount() {
        return deliveryCount;
    }

    public void setDeliveryCount(Integer deliveryCount) {
        this.deliveryCount = deliveryCount;
    }

    @Basic
    @Column(name = "deliveried_count")
    public Integer getDeliveriedCount() {
        return deliveriedCount;
    }

    public void setDeliveriedCount(Integer deliveriedCount) {
        this.deliveriedCount = deliveriedCount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        DeliveryProList that = (DeliveryProList) o;
        return deliveryProListId == that.deliveryProListId &&
                Objects.equals(deliveryCount, that.deliveryCount) &&
                Objects.equals(productList, that.productList) &&
                Objects.equals(deliveryPlan, that.deliveryPlan);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deliveryProListId, deliveryCount, productList, deliveryPlan);
    }

    @Override
    public String toString() {
        return "DeliveryProList{" +
                "deliveryProListId=" + deliveryProListId +
                ", deliveryCount=" + deliveryCount +
                ", productList=" + productList +
                ", deliveryPlan=" + deliveryPlan +
                '}';
    }
}
